package cn.mothin.dao;
 
import org.springframework.stereotype.Repository;

import cn.mothin.entity.DictionaryType;
import cn.mothin.frame.core.base.BaseDao;
@Repository ("1acf86ba-fb4a-4670-99bf-c38000daaa3f")
public class DictionaryTypeDao extends BaseDao<DictionaryType>{ 

    public boolean checkExistedByName(String name) {
        String sql = "SELECT COUNT(0) FROM dictionary_type WHERE deleted<>TRUE AND name=?";
        return sqlHelper.queryCount(sql, name)>0;
    }

    public boolean checkExistedByNameWithoutId(String name,String id) {
        String sql = "SELECT COUNT(0) FROM dictionary_type WHERE deleted<>TRUE AND name=? AND id<>?";
        return sqlHelper.queryCount(sql, name,id)>0;
    }
}
